<?php

namespace app\datacenter\model;

use app\BaseModel;

class LargeScreenCronLog extends BaseModel
{
    public $autoWriteTimestamp = true;
    public $updateTime = 'update_time';
    public $createTime = 'create_time';

    public function getOne($where = []): array
    {
        return self::where($where)->find();
    }

    /**
     * 获取最后执行时间
     * @param string $name
     * @return string
     */
    public function getCronLastTime(string $name = ''): string
    {
        return self::where(['name' => $name])->order('id desc')->field(['statistical_time'])->find();
    }
}